import Draw from "./Draw";

export default class Canvas{
   constructor(opt){
     this.name =opt.name;
     this.canvas = opt.canvas;
     this.context = this.canvas.getContext('2d')
     this.draw = new Draw(this.context)
     return this
   }
   setRender(render){
    render.bindCanvas(this)
    this.render = render
   }

   resize(){

    this.canvas.width =this.canvas.clientWidth;
    this.canvas.height =this.canvas.clientHeight;
   }
}